
#include <assert.h>
#include "utility.h"
#include "ecc-adapter.h"

void ecc_adapter_destroy(EccAdapter* ecc_adapter)
{
	if(ecc_adapter != NULL)
	{
		assert(ecc_adapter->destroy != NULL);
		ecc_adapter->destroy(ecc_adapter);
	}
}

int ecc_adapter_encode(EccAdapter* ecc_adapter, RSBlock* rs_block)
{
	if(NULL == ecc_adapter || NULL == rs_block)
	{
		RES_INVAL("Argument is invalid.");
	}
	if(NULL == ecc_adapter->encode)
	{
		RES_INVAL("Argument is invalid.");
	}

	return ecc_adapter->encode(ecc_adapter, rs_block);
}

